using System.Text.Encodings.Web;
using Volo.Abp.Autofac;
using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Modularity;

namespace Acme.MeiTuan.SDK.Tests;

[DependsOn(typeof(AcmeMeiTuanSdkModule),
    typeof(AbpAutofacModule),
    typeof(AbpJsonModule))]
public class AcmeMeiTuanSdkTestModule: AbpModule
{
    public override void PreConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpJsonOptions>(opt =>
        {
            opt.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            opt.UseHybridSerializer = false;
        });
        Configure<AbpSystemTextJsonSerializerOptions>(options =>
        {
            options.JsonSerializerOptions.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping;
        });
    }
}